// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.
use crate::Result;

/// Implements a [TopicAdmin](super::stub::TopicAdmin) decorator for logging and tracing.
#[derive(Clone, Debug)]
pub struct TopicAdmin<T>
where
    T: super::stub::TopicAdmin + std::fmt::Debug + Send + Sync,
{
    inner: T,
}

impl<T> TopicAdmin<T>
where
    T: super::stub::TopicAdmin + std::fmt::Debug + Send + Sync,
{
    pub fn new(inner: T) -> Self {
        Self { inner }
    }
}

impl<T> super::stub::TopicAdmin for TopicAdmin<T>
where
    T: super::stub::TopicAdmin + std::fmt::Debug + Send + Sync,
{
    #[tracing::instrument(ret)]
    async fn create_topic(
        &self,
        req: crate::model::Topic,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Topic>> {
        self.inner.create_topic(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn update_topic(
        &self,
        req: crate::model::UpdateTopicRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Topic>> {
        self.inner.update_topic(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_topic(
        &self,
        req: crate::model::GetTopicRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Topic>> {
        self.inner.get_topic(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_topics(
        &self,
        req: crate::model::ListTopicsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListTopicsResponse>> {
        self.inner.list_topics(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_topic_subscriptions(
        &self,
        req: crate::model::ListTopicSubscriptionsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListTopicSubscriptionsResponse>> {
        self.inner.list_topic_subscriptions(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_topic_snapshots(
        &self,
        req: crate::model::ListTopicSnapshotsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListTopicSnapshotsResponse>> {
        self.inner.list_topic_snapshots(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_topic(
        &self,
        req: crate::model::DeleteTopicRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.delete_topic(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn detach_subscription(
        &self,
        req: crate::model::DetachSubscriptionRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::DetachSubscriptionResponse>> {
        self.inner.detach_subscription(req, options).await
    }
}

/// Implements a [SubscriptionAdmin](super::stub::SubscriptionAdmin) decorator for logging and tracing.
#[derive(Clone, Debug)]
pub struct SubscriptionAdmin<T>
where
    T: super::stub::SubscriptionAdmin + std::fmt::Debug + Send + Sync,
{
    inner: T,
}

impl<T> SubscriptionAdmin<T>
where
    T: super::stub::SubscriptionAdmin + std::fmt::Debug + Send + Sync,
{
    pub fn new(inner: T) -> Self {
        Self { inner }
    }
}

impl<T> super::stub::SubscriptionAdmin for SubscriptionAdmin<T>
where
    T: super::stub::SubscriptionAdmin + std::fmt::Debug + Send + Sync,
{
    #[tracing::instrument(ret)]
    async fn create_subscription(
        &self,
        req: crate::model::Subscription,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Subscription>> {
        self.inner.create_subscription(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_subscription(
        &self,
        req: crate::model::GetSubscriptionRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Subscription>> {
        self.inner.get_subscription(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn update_subscription(
        &self,
        req: crate::model::UpdateSubscriptionRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Subscription>> {
        self.inner.update_subscription(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_subscriptions(
        &self,
        req: crate::model::ListSubscriptionsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListSubscriptionsResponse>> {
        self.inner.list_subscriptions(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_subscription(
        &self,
        req: crate::model::DeleteSubscriptionRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.delete_subscription(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn modify_push_config(
        &self,
        req: crate::model::ModifyPushConfigRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.modify_push_config(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_snapshot(
        &self,
        req: crate::model::GetSnapshotRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Snapshot>> {
        self.inner.get_snapshot(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_snapshots(
        &self,
        req: crate::model::ListSnapshotsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListSnapshotsResponse>> {
        self.inner.list_snapshots(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn create_snapshot(
        &self,
        req: crate::model::CreateSnapshotRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Snapshot>> {
        self.inner.create_snapshot(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn update_snapshot(
        &self,
        req: crate::model::UpdateSnapshotRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Snapshot>> {
        self.inner.update_snapshot(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_snapshot(
        &self,
        req: crate::model::DeleteSnapshotRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.delete_snapshot(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn seek(
        &self,
        req: crate::model::SeekRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::SeekResponse>> {
        self.inner.seek(req, options).await
    }
}

/// Implements a [SchemaService](super::stub::SchemaService) decorator for logging and tracing.
#[derive(Clone, Debug)]
pub struct SchemaService<T>
where
    T: super::stub::SchemaService + std::fmt::Debug + Send + Sync,
{
    inner: T,
}

impl<T> SchemaService<T>
where
    T: super::stub::SchemaService + std::fmt::Debug + Send + Sync,
{
    pub fn new(inner: T) -> Self {
        Self { inner }
    }
}

impl<T> super::stub::SchemaService for SchemaService<T>
where
    T: super::stub::SchemaService + std::fmt::Debug + Send + Sync,
{
    #[tracing::instrument(ret)]
    async fn create_schema(
        &self,
        req: crate::model::CreateSchemaRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Schema>> {
        self.inner.create_schema(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_schema(
        &self,
        req: crate::model::GetSchemaRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Schema>> {
        self.inner.get_schema(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_schemas(
        &self,
        req: crate::model::ListSchemasRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListSchemasResponse>> {
        self.inner.list_schemas(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_schema_revisions(
        &self,
        req: crate::model::ListSchemaRevisionsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListSchemaRevisionsResponse>> {
        self.inner.list_schema_revisions(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn commit_schema(
        &self,
        req: crate::model::CommitSchemaRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Schema>> {
        self.inner.commit_schema(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn rollback_schema(
        &self,
        req: crate::model::RollbackSchemaRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Schema>> {
        self.inner.rollback_schema(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_schema_revision(
        &self,
        req: crate::model::DeleteSchemaRevisionRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Schema>> {
        self.inner.delete_schema_revision(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_schema(
        &self,
        req: crate::model::DeleteSchemaRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.delete_schema(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn validate_schema(
        &self,
        req: crate::model::ValidateSchemaRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ValidateSchemaResponse>> {
        self.inner.validate_schema(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn validate_message(
        &self,
        req: crate::model::ValidateMessageRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ValidateMessageResponse>> {
        self.inner.validate_message(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn set_iam_policy(
        &self,
        req: iam_v1::model::SetIamPolicyRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<iam_v1::model::Policy>> {
        self.inner.set_iam_policy(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_iam_policy(
        &self,
        req: iam_v1::model::GetIamPolicyRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<iam_v1::model::Policy>> {
        self.inner.get_iam_policy(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn test_iam_permissions(
        &self,
        req: iam_v1::model::TestIamPermissionsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<iam_v1::model::TestIamPermissionsResponse>> {
        self.inner.test_iam_permissions(req, options).await
    }
}
